﻿

<style>
    .layui-form{padding:15px 0px}
    .layui-form label{text-align: justify;text-align-last: justify}
    .content_div img{width:120px;float: left;margin-right:15px;margin-bottom:15px;}
</style>

<div class="modal-body">


    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" close="true">
            <span aria-hidden="true">×</span>
        </button>
        <h4 class="modal-title">
            <span class="fa fa-legal"></span>&nbsp;志愿者信息
        </h4>
    </div>

    <form class="form-horizontal layui-form content_main" name="update" >


        <div class="form-group">
            <label class="col-sm-2 control-label">姓名</label>
            <div class="col-sm-4 content_div">
                {$registration.name}
            </div>

            <label class="col-sm-2 control-label">学历</label>
            <div class="col-sm-4 content_div">
                {$registration.schooling}
            </div>
        </div>


        <div class="form-group">
            <label class="col-sm-2 control-label">性别</label>
            <div class="col-sm-4 content_div">
                {$registration.sex}
            </div>
            <label class="col-sm-2 control-label">籍贯</label>
            <div class="col-sm-4 content_div">
                {$registration.place}
            </div>
        </div>

        <div class="form-group">

            <label class="col-sm-2 control-label">身高</label>
            <div class="col-sm-4 content_div">
                {$registration.height}
            </div>
            <label class="col-sm-2 control-label">体重</label>
            <div class="col-sm-4 content_div">
                {$registration.weight}
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">义工类型</label>
            <div class="col-sm-4 content_div">
                {$registration.volunteers}
            </div>
            <label class="col-sm-2 control-label">所在小区</label>
            <div class="col-sm-4 content_div">
                {$registration.housing}
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">身份证号</label>
            <div class="col-sm-4 content_div">
                {$registration.idcard}
            </div>
            <label class="col-sm-2 control-label">工作单位</label>
            <div class="col-sm-4 content_div">
                {$registration.work_units}
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">联系方式</label>
            <div class="col-sm-4 content_div">
                {$registration.mobile}
            </div>
            <label class="col-sm-2 control-label">身体状况</label>
            <div class="col-sm-4 content_div">
                {$registration.condition}
            </div>
        </div>



        <div class="form-group">
            <label class="col-sm-2 control-label">备注:</label>
            <div class="col-sm-4 content_div">
                {$registration.remark}
            </div>
        </div>

        {if condition="$type neq 9"}
        <div class="form-group">
            <label class="col-sm-2 control-label">参与图片:</label>
            <div class="col-sm-10 content_div">
                {volist name="$content['images']" id="vo" }
                    <img src="{$vo}">
                {/volist}
            </div>
        </div>
        {/if}



        <div class="form-group">
            {if condition="$type neq 9"}
            <label class="col-sm-2 control-label">报名时间</label>
            {else/}
            <label class="col-sm-2 control-label">加入时间</label>
            {/if}
            <div class="col-sm-4 content_div">
                {$registration.addtime|date="Y-m-d H:i:s",###}
            </div>
        </div>

        {if condition="$type neq 9"}
        <div class="form-group"  >
            <label class="col-sm-2 control-label" style="margin-top:10px;">更新状态</label>
            <div class="col-sm-10 content_div">

                {volist name="registration_status" id="vo"}
                <input type="radio" name="status" lay-filter="status" value="{$key}" title="{$vo}" {if condition="$content['status'] eq $key"} checked {/if} >
                {/volist}

            </div>
        </div>
        {/if}

        <input type="hidden" name="id" value="{$content.id}">


    </form>
</div>

<div class="modal-footer">
    <button type="button" class="layui-btn layui-btn-primary js_close" close="true">关闭</button>
    {if condition="$type neq 9"}<button type="button" class="layui-btn js_update" >更新状态</button>{/if}
    <!--    <button type="button" class="btn btn-primary btn-sm" id="newsave" _event="add">保存</button>-->
</div>


<script>

    layui.use(['form','layedit','tree','util'], function() {
        var form = layui.form
            , layer = layui.layer;
        var layedit = layui.layedit;
        var  tree = layui.tree;
        var util = layui.util;

        $(".js_update").click(function () {
            var data = $("form[name='update']").serializeArray();

            $.ajax({
                type: 'post',
                url: "{:URL('community/Content/saveRegistration')}",
                data: data,
                dataType: 'JSON',
                success: function (res) {
                    if (res.code != 0) {
                        layer.alert(res.msg);
                    } else {
                        $(".js_close").click();
                        location.reload();
                    }
                },
                error: function (res) {

                }
            });


        });

        layui.form.render('select');
        form.render();


    });
</script>

